
package com.era7bioinformatics.aws.s3.components.beta1

//  implementing this
import com.era7bioinformatics.aws.s3.components.generic.{Object, Bucket, Region}
import com.era7bioinformatics.aws.s3.components.generic.data._


import com.era7bioinformatics.common._
import com.era7bioinformatics.aws.components.AwsAccount
import com.era7bioinformatics.aws.components.AwsDate



object BucketImpl {

  def apply(name: BucketName,
            owner: AwsAccount,
            versioning: Versioning,
            acl: ACL,
            paymentConf: PaymentConf,
            date: AwsDate,
            region: Region,
            objects: List[Object]): Bucket = {

    new BucketImpl(theName = name,
                   theOwner = owner,
                   theVersioning = versioning,
                   theAcl = acl,
                   thePaymentConf = paymentConf,
                   theDate = date,
                   theRegion = region,
                   theObjects = objects)

  }
}


class BucketImpl(
  theName: BucketName,
  theOwner: AwsAccount,
  theVersioning: Versioning,
  theAcl: ACL,
  thePaymentConf: PaymentConf,
  theDate: AwsDate,
  theRegion: Region,
  theObjects: List[Object])
                                extends Bucket {

    //  val init code
    override val name = theName
    override val owner = theOwner
    override lazy val date = theDate
    override lazy val acl = theAcl
    override lazy val paymentConf = thePaymentConf
    override lazy val versioning = theVersioning
    
    val region = theRegion
    val objects = theObjects

  }
